import { get, post, remove, put } from '@/server/request'
import { baseApi, RequestCode } from '@/server/base'
import axios from 'axios'

export const  artificialMark={
          getImg(params:{userId:number|string,imageIndex:number}){
            const {userId,imageIndex}  = params
            return get(`${baseApi}/image/getImageByTask/${userId}/${imageIndex}`)
          },
          getUserSimp(type:number|string){
            return get(`${baseApi}/image/queryUserSimp/${type}`)
          },
          uploadImg(params:{base64List:any,photoListId:number|string}){
            const {base64List,photoListId}=params
            return post(`${baseApi}/image/uploadBase64/${photoListId}`,base64List)
          },
          uploadFormDataImg(params:{file:any,photoListId:number|string}){
            const {file,photoListId} =params
            return  axios.post(`${baseApi}/image/upload/${photoListId}`, file, {headers: { "Content-Type": "multipart/form-data"}})
          },
          getImgMsg(id:number|string){
            return get(`${baseApi}/annotation/getByImageId/${id}`)
          },
          searchTag(keyword :string){
            return get(`${baseApi}/label/search/${keyword}`)
          },
          countAnnotation(params:{currentImageId:number|string,photoListId:number|string,userId:number|string}){
            const {currentImageId,photoListId,userId} = params
            return post(`${baseApi}/annotation/countAnnotation/${currentImageId}/${userId}/${photoListId}`)
          },
         saveBatch(params:{imageHeight:number,imageWidth:number,imageId:number,annotationList:any[]}){
         return post(`${baseApi}/annotation/saveBatch/${params.imageHeight}/${params.imageWidth}/${params.imageId}`,params.annotationList)
        },
        saveGroupToPhotoList(params:{labelGroupId:number|string,photoListId:number|string}){
          const {labelGroupId,photoListId} =params
          return post(`${baseApi}/labelGroup/saveGroupToPhotoList/${labelGroupId}/${photoListId}`)
        },
        getLabelByPhotoList(params:{current:number,photoListId:number,size:number}){
          const {current,size,photoListId}=params
          return get(`${baseApi}/label/getLabelByPhotoList/${current}/${size}/${photoListId}`)
        }
}

